﻿<Window x:Class="Mayhem.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
		xmlns:src="clr-namespace:Mayhem.UserControls" 
		Title="Mayhem" Height="686" Width="645" ResizeMode="CanMinimize"
		Icon="Mayhem.ico"
		x:Name="MayhemMainWindow">
	<Window.Resources>
		<Style TargetType="{x:Type Button}" x:Key="EventButton">
			<Setter Property="Background">
				<Setter.Value>
					<ImageBrush ImageSource="Images\redbutton.png"/>
				</Setter.Value>
			</Setter>
			<Setter Property="Control.FontSize" Value="18" />
			<Setter Property="Control.Foreground" Value="White" />
			<Setter Property="Control.FontFamily" Value="Segoe UI" />
			<Setter Property="Control.FontWeight" Value="DemiBold" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" />
							<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,-2,0,5" >
								<ContentPresenter.Effect>
									<DropShadowEffect
									  ShadowDepth="2"
									  Direction="295"
									  Color="Black"
									  Opacity="0.8"
									 BlurRadius="10"/>
								</ContentPresenter.Effect>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		
		<Style TargetType="{x:Type Button}" BasedOn="{StaticResource EventButton}" x:Key="ReactionButton">
			<Setter Property="Background">
				<Setter.Value>
					<ImageBrush ImageSource="Images\bluebutton.png"/>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" />
							<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,-2,0,5" >
								<ContentPresenter.Effect>
									<DropShadowEffect
									  ShadowDepth="2"
									  Direction="295"
									  Color="Black"
									  Opacity="0.8"
									 BlurRadius="10"/>
								</ContentPresenter.Effect>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style TargetType="{x:Type Button}" BasedOn="{StaticResource EventButton}" x:Key="EmptyEventButton">
			<Setter Property="Background">
				<Setter.Value>
					<ImageBrush ImageSource="Images\red.png"/>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" />
							<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="25,0,0,3" >
								<ContentPresenter.Effect>
									<DropShadowEffect
									  ShadowDepth="2"
									  Direction="295"
									  Color="Black"
									  Opacity="0.8"
									 BlurRadius="10"/>
								</ContentPresenter.Effect>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style TargetType="{x:Type Button}" BasedOn="{StaticResource EventButton}" x:Key="EmptyReactionButton">
			<Setter Property="Background">
				<Setter.Value>
					<ImageBrush ImageSource="Images\blue.png"/>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" />
							<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="40,0,0,3" >
								<ContentPresenter.Effect>
									<DropShadowEffect
									  ShadowDepth="2"
									  Direction="295"
									  Color="Black"
									  Opacity="0.8"
									 BlurRadius="10"/>
								</ContentPresenter.Effect>
							</ContentPresenter>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

	</Window.Resources>
	<Grid>
		<Rectangle  x:Name="DimRectangle" Margin="2,0,-2,0" Style="{StaticResource UserControlOverlayRectangleStyle}">
			<Rectangle.Resources>
				<Storyboard x:Key="FadeIn">
					<DoubleAnimation To="0.8" Duration="00:00:00.5" Storyboard.TargetName="DimRectangle" Storyboard.TargetProperty="(Rectangle.Opacity)" />
				</Storyboard>
				<Storyboard x:Key="FadeOut">
					<DoubleAnimation To="0" Duration="00:00:00.20" Storyboard.TargetName="DimRectangle" Storyboard.TargetProperty="(Rectangle.Opacity)" />
				</Storyboard>
			</Rectangle.Resources>
		</Rectangle>

		<Grid>
			<Grid.Resources>
				<DataTemplate x:Key="errorStyle" >
					<StackPanel Orientation="Horizontal">
						<TextBlock Text="{Binding Time}" />
						<TextBlock Text="{Binding Message}" />
					</StackPanel>
				</DataTemplate>
			</Grid.Resources>
			<Grid.Triggers>
				<EventTrigger SourceName="errorView" RoutedEvent="src:ErrorView.Show">
					<BeginStoryboard>
						<Storyboard TargetName="errorView">
							<ThicknessAnimation To="0,500,0,0" Duration="00:00:00.20" Storyboard.TargetProperty="Margin" />
						</Storyboard>
					</BeginStoryboard>
				</EventTrigger>
				<EventTrigger SourceName="errorView" RoutedEvent="src:ErrorView.Hide">
					<BeginStoryboard>
						<Storyboard TargetName="errorView">
							<ThicknessAnimation To="0,630,0,0" Duration="00:00:00.20" Storyboard.TargetProperty="Margin" />
						</Storyboard>
					</BeginStoryboard>
				</EventTrigger>
				<EventTrigger SourceName="errorView" RoutedEvent="src:ErrorView.Notify">
					<BeginStoryboard>
						<Storyboard TargetName="errorView">
							<ThicknessAnimation To="0,605,0,0" Duration="00:00:00.20" Storyboard.TargetProperty="Margin" />
						</Storyboard>
					</BeginStoryboard>
				</EventTrigger>
			</Grid.Triggers>
			<StackPanel Style="{StaticResource BackgroundGradient}">
				<Image Source="/Images/header-devpreview.png" Width="641" Height="137" />
				<!--<Border BorderThickness="1" CornerRadius="20,20,20,20" BorderBrush="#D7D9DE" Padding="0,0,0,2">-->
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="25,10,0,0">
					<Button Name="buttonEmptyEvent" Content="Choose Event" Style="{StaticResource EmptyEventButton}" Width="243" Height="46" Click="EventListClick" Margin="0,0,0,0" Focusable="False" Cursor="Hand" />
					<Button Name="buttonEmptyReaction" Content="Choose Reaction" Style="{StaticResource EmptyReactionButton}" Width="243" Height="46" Click="ReactionListClick" Margin="-10,0,0,0" Focusable="False" Cursor="Hand" />
				</StackPanel>

				<Border BorderThickness="1" CornerRadius="10,10,10,10" BorderBrush="#D7D9DE" Background="#A2A6AF" Margin="10,15,10,0" Padding="0.1" >
					<Grid>
						<Border BorderThickness="1,1,0,0" CornerRadius="10,10,10,10" BorderBrush="#333333">
							<Border.Effect>
								<BlurEffect Radius="4" />
							</Border.Effect>
						</Border>
						<!--<Border.Effect>
							<DropShadowEffect Opacity="0.6" Direction="135" BlurRadius="16" ShadowDepth="5" x:Name="dropShadow"/>
						</Border.Effect>-->
						<StackPanel Orientation="Vertical" Margin="6,10,6,6">
							<ScrollViewer MaxHeight="385" VerticalScrollBarVisibility="Auto">
								<ItemsControl x:Name="RunList" HorizontalAlignment="Center">
									<ItemsControl.ItemTemplate>
										<DataTemplate>
											<!--<Border BorderThickness="0,0,0,1" BorderBrush="#FFD4D4D4">-->
											<StackPanel Orientation="Horizontal">
												<src:ModuleView Connection="{Binding}" Margin="0,0,0,10" >
												</src:ModuleView>

											</StackPanel>
											<!--</Border>-->
										</DataTemplate>
									</ItemsControl.ItemTemplate>
								</ItemsControl>
							</ScrollViewer>
						</StackPanel>
					</Grid>
				</Border>
			</StackPanel>
			<src:ErrorView Margin="0,630,0,0" x:Name="errorView">
				<src:ErrorView.Resources>
				</src:ErrorView.Resources>
			</src:ErrorView>
		</Grid>
	</Grid>
</Window>
